import DS from 'ember-data';
import BaseModel from './base-model';

export default BaseModel.extend({
  dateService: Ember.inject.service("date-service"),
  lastUpdateUser:DS.belongsTo('user'),//更新操作者userid
  createDateTime:DS.attr('number'),//创建时间
  createUser:DS.belongsTo('user'),//创建者
  payOffCount:DS.attr('number'),//开支人数
  dimissionCount:DS.attr('number'),//离职人数
  entryCount:DS.attr('number'),//新入职人数
  lastUpdateDateTime:DS.attr('number'),//更新时间
  remark:DS.attr('string'),//备注
  year:DS.attr('number'),//工资年份
  month:DS.attr('number'),//工资月份


  createDateTimeStr:Ember.computed("createDateTime",function(){
    var createDateTime = this.get("createDateTime");
    return createDateTime ? this.get("dateService").formatDate(createDateTime,"yyyy-MM-dd hh:mm") : '';
  }),

  lastUpdateDateTimeStr:Ember.computed("lastUpdateDateTime",function(){
    var lastUpdateDateTime = this.get("lastUpdateDateTime");
    return lastUpdateDateTime ? this.get("dateService").formatDate(lastUpdateDateTime,"yyyy-MM-dd hh:mm") : '';
  }),

});
